package com.teach.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.teach.dto.HotelRoomInfoDTO;
import com.teach.entity.HotelRoomType;
import com.teach.mapper.HotelRoomTypeMapper;
import com.teach.service.HotelRoomTypeService;

@Service
public class HotelRoomTypeServiceImpl implements HotelRoomTypeService {
	
	@Autowired
	private HotelRoomTypeMapper mapper;

	@Override
	public List<HotelRoomType> listAll() {
		return mapper.selectAll();
	}

	@Override
	public HotelRoomType get(Integer roomTypeId) {
		return mapper.selectByPrimaryKey(roomTypeId);
	}

	@Override
	public void add(HotelRoomType hotelRoomType) {
		mapper.insertSelective(hotelRoomType);
	}

	@Override
	public void update(HotelRoomType hotelRoomType) {
		mapper.updateByPrimaryKeySelective(hotelRoomType);
	}

	@Override
	public void delete(Integer roomTypeId) {
		mapper.deleteByPrimaryKey(roomTypeId);
	}

	@Override
	public String getRoomTypeName(Integer roomTypeId) {
		return mapper.selectRoomTypeName(roomTypeId);
	}

	@Override
	public Integer getRoomTypeId(String roomTypeName) {
		return mapper.selectRoomTypeId(roomTypeName);
	}

}
